<template>
	<view class="cardstyle">
		<text class="titlebox">{{ title }}</text>
		<view class="tipsbox">
			<text v-if="isTop" style="color: aquamarine;">置顶</text>
			<text class="text1">{{ author }}</text>
			<text>{{ comments }}评</text>
			<view style="flex:1;display: flex;justify-content: flex-end;">
				<text>{{ time }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "cardViewText",
		props: {
			title: {
				type: String,
				default: "新闻标题",
				require: true
			},
			isTop: {
				type: Boolean,
				default: false,
				require: true
			},
			author: {
				type: String,
				default: "来源",
				require: true
			},
			comments: {
				type: Number,
				default: 0,
				require: true
			},
			time: {
				type: String,
				default: "2025.1.1",
			}
		},
		data() {
			return {}
		}
	}
</script>

<style>
	.cardstyle {
			padding: 20rpx;
			background: #fff;
			border-radius: 10rpx;
			box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.1);
		}
		
		.titlebox {
			font-size: 32rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
			display: block;
		}
		
		.tipsbox {
			display: flex;
			align-items: center;
			gap: 20rpx;
			font-size: 24rpx;
			color: #666;
		}
		
		.text1 {
			font-size: 14rpx;
		}
</style>